package com.crm.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.sys.dao.ApproveConfigureDao;
import com.crm.sys.model.ApproveConfigure;
import com.crm.sys.model.ApproveConfigureItem;
@Repository("approveConfigureDao")
public class ApproveConfigureDaoImpl  extends BaseDao  implements ApproveConfigureDao {

	private static final String MAPPER_NAMESAPCE = "ApproveConfigureMapper.";
	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insertSelective(ApproveConfigure record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public ApproveConfigure selectByPrimaryKey(String code) {
		return selectOne(MAPPER_NAMESAPCE+"selectByPrimaryKey", code);
	}

	@Override
	public int updateByPrimaryKeySelective(ApproveConfigure record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(ApproveConfigure record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(ApproveConfigure record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<ApproveConfigure> getAllApproveConfigureList(ApproveConfigure ac) {
		List<ApproveConfigure> list = selectList(MAPPER_NAMESAPCE+"getAllApproveConfigureList", ac);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getAllApproveConfigureListCount", ac));
		}
		return list;
	}

	@Override
	public List<ApproveConfigureItem> getApproveUserListByAcid(
			ApproveConfigureItem aci) {
		List<ApproveConfigureItem> list = selectList(MAPPER_NAMESAPCE+"getApproveUserListByAcid", aci);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getApproveUserCountByAcid", aci));
		}
		return list;
	}

	@Override
	public int getApproveUserCount(ApproveConfigureItem aci) {
		return selectOne(MAPPER_NAMESAPCE+"getApproveUserCountByAcid", aci);
	}

	@Override
	public int insertApproveUser(ApproveConfigureItem aci) {
		return insert(MAPPER_NAMESAPCE+"insertApproveUser", aci);
	}

	@Override
	public int updateApproveUser(ApproveConfigureItem aci) {
		return update(MAPPER_NAMESAPCE+"updateApproveUser", aci);
	}

	@Override
	public List<ApproveConfigureItem> getApproveUserChanegList(
			ApproveConfigureItem aci) {
		List<ApproveConfigureItem> list = selectList(MAPPER_NAMESAPCE+"getApproveUserChanegList", aci);
		return list;
	}

	@Override
	public int deleteApproveUser(ApproveConfigureItem aci) {
		return delete(MAPPER_NAMESAPCE+"deleteApproveUser", aci);
	}

 
}
